
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>设计模式 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="../" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    说明
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter active" data-level="2.1" data-path="./">
            
                <a href="./">
            
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" >
            
                <span>
            
                    
                    创建型模式
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1.1" >
            
                <span>
            
                    
                    简单工厂模式
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.2" >
            
                <span>
            
                    
                    工厂方法模式
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.3" data-path="src/main/java/createdmodel/abstractfactorymode/">
            
                <a href="src/main/java/createdmodel/abstractfactorymode/">
            
                    
                    抽象工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.4" data-path="src/main/java/createdmodel/bulidermode/">
            
                <a href="src/main/java/createdmodel/bulidermode/">
            
                    
                    建造者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.5" data-path="src/main/java/createdmodel/prototypemode/">
            
                <a href="src/main/java/createdmodel/prototypemode/">
            
                    
                    原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.6" data-path="src/main/java/createdmodel/singletonmode/">
            
                <a href="src/main/java/createdmodel/singletonmode/">
            
                    
                    单例模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="src/main/java/structuredmodel/">
            
                <a href="src/main/java/structuredmodel/">
            
                    
                    结构型模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.2.1" data-path="src/main/java/structuredmodel/proxymode/">
            
                <a href="src/main/java/structuredmodel/proxymode/">
            
                    
                    代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.2" data-path="src/main/java/structuredmodel/adaptermode/">
            
                <a href="src/main/java/structuredmodel/adaptermode/">
            
                    
                    适配器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.3" data-path="src/main/java/structuredmodel/bridgemode/">
            
                <a href="src/main/java/structuredmodel/bridgemode/">
            
                    
                    桥接模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.4" data-path="src/main/java/structuredmodel/decoratormode/">
            
                <a href="src/main/java/structuredmodel/decoratormode/">
            
                    
                    装饰模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.5" data-path="src/main/java/structuredmodel/facademode/">
            
                <a href="src/main/java/structuredmodel/facademode/">
            
                    
                    外观模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.6" data-path="src/main/java/structuredmodel/flyweightmode/">
            
                <a href="src/main/java/structuredmodel/flyweightmode/">
            
                    
                    享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.7" data-path="src/main/java/structuredmodel/compositemode/">
            
                <a href="src/main/java/structuredmodel/compositemode/">
            
                    
                    组合模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="src/main/java/behavioralmodel/">
            
                <a href="src/main/java/behavioralmodel/">
            
                    
                    行为型模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.3.1" data-path="src/main/java/behavioralmodel/templatemethodmode/">
            
                <a href="src/main/java/behavioralmodel/templatemethodmode/">
            
                    
                    模板方法模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.2" data-path="src/main/java/behavioralmodel/strategymode/">
            
                <a href="src/main/java/behavioralmodel/strategymode/">
            
                    
                    策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.3" data-path="src/main/java/behavioralmodel/commandmode/">
            
                <a href="src/main/java/behavioralmodel/commandmode/">
            
                    
                    命令模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.4" data-path="src/main/java/behavioralmodel/chainofresponsibility/">
            
                <a href="src/main/java/behavioralmodel/chainofresponsibility/">
            
                    
                    责任链模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.5" data-path="src/main/java/behavioralmodel/statemode/">
            
                <a href="src/main/java/behavioralmodel/statemode/">
            
                    
                    状态模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.6" data-path="src/main/java/behavioralmodel/observermode/">
            
                <a href="src/main/java/behavioralmodel/observermode/">
            
                    
                    观察者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.7" data-path="src/main/java/behavioralmodel/mediatormode/">
            
                <a href="src/main/java/behavioralmodel/mediatormode/">
            
                    
                    中介者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.8" data-path="src/main/java/behavioralmodel/iteratormode/">
            
                <a href="src/main/java/behavioralmodel/iteratormode/">
            
                    
                    迭代器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.9" data-path="src/main/java/behavioralmodel/visitormode/">
            
                <a href="src/main/java/behavioralmodel/visitormode/">
            
                    
                    访问者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.10" data-path="src/main/java/behavioralmodel/mementomode/">
            
                <a href="src/main/java/behavioralmodel/mementomode/">
            
                    
                    备忘录模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.11" data-path="src/main/java/behavioralmodel/interpretermode/">
            
                <a href="src/main/java/behavioralmodel/interpretermode/">
            
                    
                    解释器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../Nacos/">
            
                <a href="../Nacos/">
            
                    
                    Nacos
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="../Nacos/Nacos-Introduction.html">
            
                <a href="../Nacos/Nacos-Introduction.html">
            
                    
                    Nacos介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="../Nacos/Nacos-Registration.html">
            
                <a href="../Nacos/Nacos-Registration.html">
            
                    
                    Nacos注册中心
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="../Nacos/Nacos-OpenFeign.html">
            
                <a href="../Nacos/Nacos-OpenFeign.html">
            
                    
                    Nacos+OpenFeign
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../Sortings/">
            
                <a href="../Sortings/">
            
                    
                    排序算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="../Sortings/src/main/java/com/larscheng/www/InsertionSort/">
            
                <a href="../Sortings/src/main/java/com/larscheng/www/InsertionSort/">
            
                    
                    插入排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="../Sortings/src/main/java/com/larscheng/www/shellSort/">
            
                <a href="../Sortings/src/main/java/com/larscheng/www/shellSort/">
            
                    
                    希尔排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3" >
            
                <span>
            
                    
                    选择排序
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4" >
            
                <span>
            
                    
                    堆排序
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5" >
            
                <span>
            
                    
                    希尔排序
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >设计模式</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#x5B66;&#x4E60;&#x7B14;&#x8BB0;">&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#x5B66;&#x4E60;&#x7B14;&#x8BB0;</h2>
<h3 id="&#x8BF4;&#x660E;">&#x8BF4;&#x660E;</h3>
<blockquote>
<p>&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#x662F;&#x8BB8;&#x8BB8;&#x591A;&#x591A;&#x4EE3;&#x7801;&#x8BBE;&#x8BA1;&#x7ECF;&#x9A8C;&#x7684;&#x603B;&#x7ED3;&#xFF0C;&#x662F;&#x89E3;&#x51B3;&#x7279;&#x5B9A;&#x95EE;&#x9898;&#x7684;&#x4E00;&#x7CFB;&#x5217;&#x5957;&#x8DEF;<br>&#x662F;&#x524D;&#x8F88;&#x4EEC;&#x7684;&#x4EE3;&#x7801;&#x8BBE;&#x8BA1;&#x7ECF;&#x9A8C;&#x7684;&#x603B;&#x7ED3;&#xFF0C;&#x5177;&#x6709;&#x4E00;&#x5B9A;&#x7684;&#x666E;&#x904D;&#x6027;&#xFF0C;&#x53EF;&#x4EE5;&#x53CD;&#x590D;&#x4F7F;&#x7528;&#x3002;<br>&#x5176;&#x76EE;&#x7684;&#x662F;&#x4E3A;&#x4E86;&#x63D0;&#x9AD8;&#x4EE3;&#x7801;&#x7684;&#x53EF;&#x91CD;&#x7528;&#x6027;&#x3001;&#x4EE3;&#x7801;&#x7684;&#x53EF;&#x8BFB;&#x6027;&#x548C;&#x4EE3;&#x7801;&#x7684;&#x53EF;&#x9760;&#x6027;&#x3002;</p>
</blockquote>
<p>&#x4E00;&#x76F4;&#x9053;&#x542C;&#x9014;&#x8BF4;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#xFF0C;&#x4E00;&#x76F4;&#x60F3;&#x8981;&#x9605;&#x8BFB;&#x548C;&#x5B66;&#x4E60;&#x8FD9;&#x4E9B;&#x7ECF;&#x5178;&#x7684;&#x8BBE;&#x8BA1;&#x7ECF;&#x9A8C;&#x3002;&#x4ECA;&#x5929;&#x7EC8;&#x4E8E;&#x5F00;&#x59CB;&#x4E86;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#x7684;&#x5B66;&#x4E60;&#x5386;&#x7A0B;&#xFF0C;
&#x672C;&#x4E66;&#x662F;&#x5B66;&#x4E60;&#x8FC7;&#x7A0B;&#x4E2D;&#x7684;&#x4E00;&#x4E9B;&#x7B14;&#x8BB0;&#x548C;&#x4EE3;&#x7801;&#xFF0C;&#x4F1A;&#x9646;&#x7EED;&#x66F4;&#x65B0;&#xFF0C;&#x5982;&#x679C;&#x89C9;&#x5F97;&#x6709;&#x5E2E;&#x52A9;&#x5230;&#x4F60;&#xFF0C;&#x8BB0;&#x5F97;&#x6536;&#x85CF;&#x5173;&#x6CE8;&#x54E6;</p>
<p>&#x672C;&#x4E66;&#x53EA;&#x662F;&#x7B80;&#x5355;&#x7684;&#x5B66;&#x4E60;&#x8BB0;&#x5F55;&#xFF0C;&#x540E;&#x7EED;&#x6211;&#x4F1A;&#x5728;&#x535A;&#x5BA2;&#x4E2D;&#x5206;&#x7AE0;&#x8282;&#x603B;&#x7ED3;&#x6BCF;&#x79CD;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#xFF0C;&#x535A;&#x5BA2;&#x5730;&#x5740;&#xFF1A;<a href="http://larscheng.coding.me/" target="_blank">LarsCheng</a></p>
<h3 id="&#x601D;&#x7EF4;&#x5BFC;&#x56FE;">&#x601D;&#x7EF4;&#x5BFC;&#x56FE;</h3>
<p>&#x5730;&#x5740;&#xFF1A;<a href="https://www.processon.com/embed/mind/5d0707c9e4b0daf4819ff442" target="_blank">&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;</a></p>
<iframe id="embed_dom" name="embed_dom" frameborder="0" style="display:block;width:700px; height:400px;" src="https://www.processon.com/embed/mind/5d0707c9e4b0daf4819ff442"></iframe>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 说明">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"设计模式","level":"2.1","depth":1,"next":{"title":"创建型模式","level":"2.1.1","depth":2,"ref":"","articles":[{"title":"简单工厂模式","level":"2.1.1.1","depth":3,"ref":"","articles":[]},{"title":"工厂方法模式","level":"2.1.1.2","depth":3,"ref":"","articles":[]},{"title":"抽象工厂模式","level":"2.1.1.3","depth":3,"path":"Design-Patterns/src/main/java/createdmodel/abstractfactorymode/README.MD","ref":"Design-Patterns/src/main/java/createdmodel/abstractfactorymode/README.MD","articles":[]},{"title":"建造者模式","level":"2.1.1.4","depth":3,"path":"Design-Patterns/src/main/java/createdmodel/bulidermode/README.MD","ref":"Design-Patterns/src/main/java/createdmodel/bulidermode/README.MD","articles":[]},{"title":"原型模式","level":"2.1.1.5","depth":3,"path":"Design-Patterns/src/main/java/createdmodel/prototypemode/README.md","ref":"Design-Patterns/src/main/java/createdmodel/prototypemode/README.md","articles":[]},{"title":"单例模式","level":"2.1.1.6","depth":3,"path":"Design-Patterns/src/main/java/createdmodel/singletonmode/README.md","ref":"Design-Patterns/src/main/java/createdmodel/singletonmode/README.md","articles":[]}]},"previous":{"title":"说明","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["expandable-chapters","livereload"],"pluginsConfig":{"expandable-chapters":{},"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"Design-Patterns/README.md","mtime":"2019-07-08T11:35:51.307Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-09T07:20:35.937Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

